<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>设置</title>
<meta name="keywords" content="前端模板">
<meta name="description" content="前端模板">

<script src="/view/front/static/js/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="/view/front/static/layui/layui.js" type="text/javascript"></script>
<script src="/view/front/static/js/index/index.js" type="text/javascript"></script>
<script src="/view/front/static/js/index/freezeheader.js" type="text/javascript"></script>
<script src="/view/front/static/layui/lay/modules/layer.js" type="text/javascript"></script>
<script src="/view/front/static/js/index/sliders.js" type="text/javascript"></script>
<script src="/view/front/static/js/index/html5.js" type="text/javascript"></script>
<script src="/view/front/static/js/index/set.js" type="text/javascript"></script>
<link rel="stylesheet" href="/view/front/static/layui/css/layui.css" media="all"/>
<link rel="stylesheet" href="/view/front/static/layui/css/modules/layer/default/layer.css"/>
<link rel="stylesheet" href="/view/front/static/css/global.css"/>
</head>
<body>
<div class="layui-header header" id="divvuehtml">
    	<div class="main">
          <p class="logop">学生档案数字管理系统</p>
          <ul class="layui-nav layui-nav-left" lay-filter="filter">
            <li class="layui-nav-item  nav-left">
              <a href="/view/front/index.html">军训信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/tyzl.html">团员资料</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/tjxx.html">体检信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/sxxx.html">实习信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/cjxx.html">成绩信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/zhengshu.html">证书信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/chufen.html">处分信息</a>
            </li>
            <li class="layui-nav-item">
              <a href="/view/front/jiangjin.html">奖金信息</a>
            </li>
            </ul>
            <ul class="layui-nav layui-layout-right layui-nav-right" lay-filter="filter">
              <li class="layui-nav-item">
                <a href="javascript:;"><img src="/view/front/static/images/head.jpg" class="layui-nav-img">{{userItem.name!=null ? userItem.name : userItem.account}}</a>
                <dl class="layui-nav-child">
                  <dd><a href="set.html">修改信息</a></dd>
                  <dd><a href="/sys/main/index.do">跳到后台管理</a></dd>
                  <dd><a href="/">退了</a></dd>
                </dl>
              </li>
          </ul>
       </div>
    </div>

    <div class="layui-container container" style="padding-top:70px;">
   
    	<div class="main fly-user-main layui-clear">
  <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
    <li class="layui-nav-item layui-this">
      <a href="set.html">
        <i class="layui-icon">&#xe620;</i>
        修改密码
      </a>
    </li>
  </ul>

  
  <div class="fly-panel fly-panel-user">
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li class="layui-this" lay-id="pass">修改密码</li>
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">

          <div class="layui-form layui-form-pane layui-tab-item layui-show">
            <form class="layui-form" method="post" action="#">
              <div class="layui-form-item">
                <label for="L_nowpass" class="layui-form-label">当前密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_nowpass" name="pwd" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">新密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="newPwd" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">确认密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_repass" name="aginPwd" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" lay-filter="formDemo" lay-submit>确认修改</button>
              </div>
            </form>
          </div>

        </div>

      </div>
    </div>
  </div>
</div>
</body>
<script type="text/javascript" src="/static/js/vue.js"></script>
<script type="text/javascript" src="/static/js/xadmin.js"></script>
<script type="text/javascript">
  var ve = new Vue({
    el: '#divvuehtml',//绑定vue渲染范围
    data: {
      userItem:{}
    },
    created: function () {//vue在打开html前初始化创建函数
      this.getUser();  //获取用户信息
    },mounted: function () {//初始化html完成后在进行操作
        layui.use(['table','form','layer','element'],function() {
          var form = layui.form;
          var layer = layui.layer;
          var element = layui.element;
          element.render();
          //监听提交
          form.on('submit(formDemo)', function(data){
            var index;
            $.ajax({
              url : "/api/login/updatePassWord.do",
              type : "POST",
              data : data.field,
              dataType : "json",
              beforeSend : function(XMLHttpRequest) {
                index = layer.msg('正在提交数据中，请稍候', {
                  icon : 16,
                  time : false,
                  shade : 0.8
                });
              },success : function(data) {
                if(data.success){
                  xadmin.alert(data.msg,1)
                }else{
                  xadmin.alert(data.msg,2)
                }
              },complete : function(XMLHttpRequest, textStatus) {
                layer.close(index);
              },error : function(data) {
                layer.alert('网络异常或者数据错误', {
                  icon : 2
                });
              }
            });
            return false;
          });
        });

    },methods: {//调用函数
     getUser: function(){
        $.get("/api/login/getUserInfo.do",{},function(data){
          if(data.success){
            ve.userItem = data.data;
          }else{
            layer.alert(data.msg,{icon:5})
          }
        },"json")
      }
    },updated: function () {
      layui.use('element', function(){
        var element = layui.element;
        element.render();
      });
    }
  });
</script>
</html>